#include "Game.h"

//onInit-
bool Game::OnInit() {
    //init SDL
    if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        return false;
    }

    //init video
    if((Surf_Display = SDL_SetVideoMode(WWIDTH, WHEIGHT, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL) {
        return false;
    }

    //Init SDL_ttf
    if(TTF_Init() == -1){
        return false;
    }

    //Set window caption
    SDL_WM_SetCaption( "Something Adventurous", NULL );

    SDL_EnableKeyRepeat(1, SDL_DEFAULT_REPEAT_INTERVAL / 3);

    //set active gamestate to the intro
    GameStateManager::SetActiveGameState(GAMESTATE_INTRO);

    //everything initialized fine
    return true;
}
